import 'package:flutter_shark_im/entity/message/authentication_entity.dart';
import 'package:flutter_shark_im/entity/message/authentication_response_entity.dart';
import 'package:flutter_shark_im/entity/message/common_response_entity.dart';
import 'package:flutter_shark_im/entity/message/receive_entity.dart';
import 'package:flutter_shark_im/entity/message/user_list_response_entity.dart';

import 'entity/message/base_message_entity.dart';
import 'entity/message/send_entity.dart';

class EntityFactory {
  static T generateOBJ<T>(json) {
    if (1 == 0) {
      return null;
    } else if (T.toString() == "AuthenticationEntity") {
      return AuthenticationEntity.fromJson(json) as T;
    } else if (T.toString() == "AuthenticationResponseEntity") {
      return AuthenticationResponseEntity.fromJson(json) as T;
    } else if (T.toString() == "CommonResponseEntity") {
      return CommonResponseEntity.fromJson(json) as T;
    } else if (T.toString() == "ReceiveEntity") {
      return ReceiveEntity.fromJson(json) as T;
    } else if (T.toString() == "SendEntity") {
      return SendEntity.fromJson(json) as T;
    } else if (T.toString() == "UserListResponseEntity") {
      return UserListResponseEntity.fromJson(json) as T;
    } else if (T.toString() == "HeartBeatEntity") {
      return HeartBeatEntity.fromJson(json) as T;
    } else if (T.toString() == "GetUserListEntity") {
      return GetUserListEntity.fromJson(json) as T;
    } else {
      return null;
    }
  }
}